home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Plug-In Power Pack for Netscape Communicator
/
Plug-In Power Pack for Netscape Communicator.iso
/
plugins
/
dataviews
/
include
/
dvgr.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-06-30
|
16KB
|
382 lines
#ifndef DVGR_H
#define DVGR_H
/* file name -- dvGR.h
|===================================================================
|
| copyright (c) 1987
| V.I. Corporation
|
| dvGR - defines and declarations for use with GR graphics primitives
|
| alan morse 12 sep 84 Derived from dvprim.hdr
| alan morse 1 Oct 86 Add flags for GX*intersect
| chris hoffmann 31 jan 91 Added RAS_GPIX, SPIX, mask & drawpart
|
|===================================================================
*/
/*===================================================================
|
| GRrasquery flags indicating the type of question being asked
| of the device.
*/
#define RAS_MOVE 11
#define RAS_DRAW 12
#define RAS_GET 13
#define RAS_CREATE 14
#define RAS_SAVE 15
#define RAS_GPIX 16
#define RAS_SPIX 17
#define RAS_SPIXELS 18
#define RAS_DRAWPART 19
#define RAS_SMASK 20
#define RAS_SPXRP 21
#define RAS_GPXRP 22
#define RAS_SMASKPXRP 23
/* Possible answers returned by GRrasquery */
#define YES_BUT_SLOW 20
#define YES_BUT_MSC 40 /* Machine specific changes */
/*====================================================================
|
| GRlocate and GRcr_poll macros that help extract information about
| the keyboard or button event that might have occurred. Users
| of these routines should always use these macros to determine
| the nature of the event. Currently, the convention is that
| numbers in the range [1,3] are the buttons on the mouse
| (numbered from left to right), NULL (0) means there was no
| key or button press, and the others [4,126] correspond to
| key board presses. (NOTE that some key presses may have been
| intercepted by the system and are therefore impossible.)
*/
/* Button flags */
#define V_BUTTON1 1
#define V_BUTTON2 2
#define V_BUTTON3 3
/* Macro to SET the information for a given mouse button press */
/* ONLY used internally by GR device driver routines. */
#define GR_SET_BUTTON(button_number) ((int)(0x3 & button_number))
/* Macro to GET the number of the mouse button that was pressed. */
/* The result is NULL if no button was pressed */
#define GR_BUTTON(key_code) ((int)((key_code>3)?0:key_code))
/* Macro to SET the information for a given keyboard keypress */
/* ONLY used internally by GR device driver routines. */
#define GR_SET_KEY(key) ((int)((key>3)?key:0))
/* Macro to SET the information for a given function key keypress */
/* ONLY used internally by GR device driver routines. NEEDED BY VT340 */
#ifdef VMS
#define GR_SET_FUNCTION_KEY(key) (((int)(key)>127)?0:((int)(key)|0x0080))
#endif
/* Macro to GET the keyboard key that was pressed. */
/* The result is NULL if no key was pressed */
#define GR_KEY(key_code) ((int)((key_code>3)?key_code:0))
/*===================================================================
|
| CR_EVENT flags. These specify the events that the cursor poll
| routine is to use as its criteria for returning. See the
| description of GRcr_event for an explanation of how these
| flags affect the operation of GRcr_poll.
*/
#define V_LOC_CHANGE_WAIT 1
#define V_LOC_PICK_WAIT 2
#define V_LOC_NO_WAIT 3
#define V_LOC_PICK_NO_WAIT 4
/*===================================================================
|
| Flags indicating the relationship of an object
| to a viewport. These are returned by the GX*Intersect routines.
*/
#define V_INSIDE_VP 1 /* Entirely inside the viewport */
#define V_OUTSIDE_VP 0 /* Entirely outside the viewport */
#define V_INTERSECTS_VP -1 /* Partially inside the viewport */
/*===================================================================
|
| Flags relating to setting and querying the status of trailing edges
| in the input stream, i.e. whether "up" key transitions can be or
| should be reported as well as "down" key transitions. Some
| devices have trailing edges reported on the locater device but
| not on the keyboard.
| These flags are used by the GRcr... routines.
*/
#define V_TRL_OFF 0 /* trailing edges selected */
#define V_TRL_ON 1 /* trailing edges not selected */
#define V_TRL_CAPABLE 2 /* trailing edges capability */
#define V_TRL_KBCAPABLE 4 /* no trailing edges capability on kb*/
/*
|===================================================================
|
| new structures and constants for GR extensions
|
|===================================================================
*/
/*
* Window Event structure for GRwe_poll routine.
*/
typedef struct _winevent
{
int devnum; /* device number of window on which event occurred */
ULONG type; /* type of event */
ULONG time; /* time of event */
LONG count; /* at least this many more events */
ADDRESS eventdata; /* device-dependent structure with more data */
DV_POINT loc; /* location of cursor relative to window */
RECTANGLE region; /* exposed region (EXPOSE) */
DV_POINT maxpoint; /* new size of window (CONFIGURENOTIFY) */
ULONG state; /* state of modifier keys */
ULONG button; /* button code for mouse button events */
ULONG keycode; /* physical key code */
ULONG keysym; /* virtual key symbol code */
char *keystring; /* key string equivalent */
LONG nchars; /* length of ascii string */
UBYTE firstchar; /* first ascii character of key string */
RECTANGLE *rectlist; /* array of consecutive exposed regions */
DV_POINT root_loc; /* absolute location of cursor on display device */
} WINEVENT;
/*
* GRwe_poll polling modes.
*/
#define V_WAIT 1
#define V_NO_WAIT 2
#define V_PEEK 3 /* unsupported */
#define V_PEEK_NO_WAIT 3 /* unsupported */
/*
* GRwe_poll polling sources.
*/
#define V_CURRENT_WINDOW 1
#define V_MULTIPLE_WINDOW 2
/*===================================================================
|
| Flags for representing event types and setting the event mask
*/
#define V_ALL_MASKED_EVENTS (0)
#define V_KEYPRESS (1<<0)
#define V_KEYRELEASE (1<<1)
#define V_BUTTONPRESS (1<<2)
#define V_BUTTONRELEASE (1<<3)
#define V_MOTIONNOTIFY (1<<4)
#define V_ENTERNOTIFY (1<<5)
#define V_LEAVENOTIFY (1<<6)
#define V_EXPOSE (1<<7)
#define V_RESIZE (1<<8)
#define V_WINDOW_QUIT (1<<9)
#define V_WINDOW_ICONIFY (1<<10)
#define V_NON_STANDARD_EVENT (1<<11)
#define V_NON_DV_WINDOW_EVENT (1<<12)
#define V_EVENTS_OFF (1<<16)
#define V_NO_EVENT (1<<17)
#define V_ADD_TO_MASK (1<<18)
#define V_XWINDOW_MASK (1<<24)
#define V_SUNVIEW_PICK_MASK (1<<25)
#define V_SUNVIEW_KBD_MASK (1<<26)
#define V_WINNT_MASK (1<<27)
/* WINEVENT state mask flags */
#define V_STATE_SHIFT (1<<0)
#define V_STATE_LOCK (1<<1)
#define V_STATE_CONTROL (1<<2)
#define V_STATE_MOD1 (1<<3)
#define V_STATE_MOD2 (1<<4)
#define V_STATE_MOD3 (1<<5)
#define V_STATE_MOD4 (1<<6)
#define V_STATE_MOD5 (1<<7)
#define V_STATE_BUTTON1 (1<<8)
#define V_STATE_BUTTON2 (1<<9)
#define V_STATE_BUTTON3 (1<<10)
#define V_STATE_BUTTON4 (1<<11)
#define V_STATE_BUTTON5 (1<<12)
/*
* GRget/GRset flags
*/
#define V_OPEN_SET_MAGIC 0x55500000
#define V_OPEN (1 << 0)
#define V_GET (1 << 1)
#define V_SET (1 << 2)
#define V_BUILD_FLAG(when, arg_count, value) \
((ULONG)( (0xfff00000 & V_OPEN_SET_MAGIC) \
| (0x000f0000 & ((when) << 16)) \
| (0x0000fff0 & ((value) << 4)) \
| (0x0000000f & ((arg_count) << 0))))
#define V_IS_GET_FLAG(flag) ((((flag) & 0xfff00000) == V_OPEN_SET_MAGIC) \
&& ((flag) & (V_GET << 16)))
#define V_IS_SET_FLAG(flag) ((((flag) & 0xfff00000) == V_OPEN_SET_MAGIC) \
&& ((flag) & (V_SET << 16)))
#define V_IS_OPEN_FLAG(flag) ((((flag) & 0xfff00000) == V_OPEN_SET_MAGIC) \
&& ((flag) & (V_OPEN << 16)))
#define V_ARG_COUNT(flag) (flag & 0x0000000f)
#define V_IS_VALID_FLAG(flag) (( ((flag) & 0xfff00000) == V_OPEN_SET_MAGIC)\
&& ((flag) & 0x000f0000) \
&& (((flag) & 0x0000fff0) < 0x8000) \
&& (V_ARG_COUNT(flag) < 3))
/* drawing context parameters */
#define V_END_OF_LIST 0
#define V_VARARG_LIST 0x1 /* internal */
/* draw function and it's possible values */
#define V_DRAW_FUNCTION V_BUILD_FLAG(V_GET|V_SET|V_OPEN,1, 0x001)
#define V_XOR 1
#define V_COPY 2
/* window system data structures */
#define V_INPUT_FD V_BUILD_FLAG(V_GET, 1, 0x100)
#define V_WINDOW_ID V_BUILD_FLAG(V_OPEN|V_GET, 1, 0x101)
#define V_DISPLAY V_BUILD_FLAG(V_OPEN|V_GET, 1, 0x102)
#define V_SHELL V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x103)
#define V_DRAW_WIDGET V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x104)
#define V_CURSOR V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x105)
#define V_ICON V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x106)
#define V_ICON_NAME V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x107)
#define V_MOTION_COLLAPSE V_BUILD_FLAG(V_SET|V_OPEN, 1, 0x108)
#define V_EXPOSE_COLLAPSE V_BUILD_FLAG(V_SET|V_OPEN, 1, 0x109)
#define V_DV_WINEVENT_ONLY V_BUILD_FLAG(V_SET|V_OPEN, 1, 0x10A)
/* various dimensions */
#define V_WINDOW_WIDTH V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x200)
#define V_WINDOW_HEIGHT V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x201)
#define V_WINDOW_X V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x202)
#define V_WINDOW_Y V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x203)
#define V_WINDOW_NAME V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x204)
#define V_CLUT_DEPTH V_BUILD_FLAG(V_GET, 1, 0x205)
#define V_RASTER_DEPTH V_BUILD_FLAG(V_GET, 1, 0x206)
#define V_EVENTS_REPORTED V_BUILD_FLAG(V_GET, 1, 0x207)
/* VI predefined cursors */
#define V_ACTIVE_CURSOR V_BUILD_FLAG(V_SET|V_OPEN, 0, 0x300)
#define V_INITIAL_CURSOR V_BUILD_FLAG(V_SET|V_OPEN, 0, 0x301)
/* queries about capabilities of driver/system */
#define V_HAS_WINEVENTS V_BUILD_FLAG(V_GET, 1, 0x400)
#define V_HAS_PLANE_MASKING V_BUILD_FLAG(V_GET, 1, 0x401)
#define V_HAS_XOR V_BUILD_FLAG(V_GET, 1, 0x402)
#define V_IS_BLACK_AND_WHITE V_BUILD_FLAG(V_GET, 1, 0x403)
#define V_IS_WINDOW_SYSTEM V_BUILD_FLAG(V_GET, 1, 0x404)
#define V_NUM_FONTS V_BUILD_FLAG(V_GET, 1, 0x405)
#define V_NUM_MBFONTS V_BUILD_FLAG(V_GET, 1, 0x406)
/* SunView-specific data structures */
#define V_SV_CURSOR V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x500)
#define V_SV_CANVAS V_BUILD_FLAG(V_GET|V_OPEN,1, 0x501)
#define V_SV_FRAME V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x502)
#define V_SV_ICON V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x503)
#define V_SV_FRAME_WIDTH V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x504)
#define V_SV_FRAME_HEIGHT V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x505)
#define V_SV_FRAME_X V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x506)
#define V_SV_FRAME_Y V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x507)
#define V_SV_FRAME_LABEL V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x508)
/* X11-specific data structures */
#define V_X_WINDOW_ID V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x600)
#define V_X_DISPLAY V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x601)
#define V_X_DISPLAY_NAME V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x602)
#define V_X_APPLIC_CLASS V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x603)
#define V_X_APPLIC_NAME V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x604)
#define V_X_ARGC V_BUILD_FLAG(V_OPEN, 1, 0x605)
#define V_X_ARGV V_BUILD_FLAG(V_OPEN, 1, 0x606)
#define V_X_CURSOR V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x607)
#define V_X_ICON V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x608)
#define V_X_ICON_WIDTH V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x609)
#define V_X_ICON_HEIGHT V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x60A)
#define V_X_SHELL V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x60B)
#define V_X_DRAW_WIDGET V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x60C)
#define V_X_FONTSTRUCT V_BUILD_FLAG(V_SET|V_GET|V_OPEN,2, 0x60D)
#define V_X_APPLIC_CONTEXT V_BUILD_FLAG(V_GET|V_OPEN, 1, 0x60E)
#define V_X_RAS_SYNC V_BUILD_FLAG(V_GET|V_SET|V_OPEN,1, 0x60F)
#define V_XT_INITIALIZED V_BUILD_FLAG(V_GET|V_SET|V_OPEN,1, 0x610)
#define V_X_OPTIONS V_BUILD_FLAG(V_OPEN, 1, 0x611)
#define V_X_OPTIONS_COUNT V_BUILD_FLAG(V_OPEN, 1, 0x612)
#define V_X_EXPOSURE_BLOCK V_BUILD_FLAG(V_OPEN|V_SET|V_GET,1, 0x613)
#define V_X_RESIZE_BLOCK V_BUILD_FLAG(V_OPEN|V_SET|V_GET,1, 0x614)
#define V_X_DOUBLE_BUFFER V_BUILD_FLAG(V_OPEN|V_SET|V_GET,1, 0x615)
#define V_X_COLORMAP V_BUILD_FLAG(V_OPEN|V_SET|V_GET,1, 0x616)
#define V_X_PIXELS V_BUILD_FLAG(V_OPEN|V_SET|V_GET,2, 0x617)
#define V_X_PLANES V_BUILD_FLAG(V_OPEN|V_SET|V_GET,2, 0x618)
#define V_X_GC V_BUILD_FLAG(V_GET, 1, 0x619)
#define V_X_POLY_HINT V_BUILD_FLAG(V_OPEN|V_SET|V_GET,1, 0x61A)
#define V_X_IMAGE_STRING V_BUILD_FLAG(V_OPEN|V_SET|V_GET,1, 0x61B)
#define V_X_DASH_STYLE V_BUILD_FLAG(V_OPEN|V_SET|V_GET,1, 0x61C)
#define V_X_ICON_X V_BUILD_FLAG(V_OPEN, 1, 0x61D)
#define V_X_ICON_Y V_BUILD_FLAG(V_OPEN, 1, 0x61E)
#define V_X_ICONIC V_BUILD_FLAG(V_OPEN, 1, 0x61F)
#define V_X_MBFONTSTRUCT V_BUILD_FLAG(V_SET|V_GET|V_OPEN,2, 0x620)
/* VWS (UIS, GPX) specific data structures */
#define V_UIS_CURSOR V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x701)
#define V_UIS_ICON V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x702)
#define V_UIS_EVENT_FLAG V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x703)
#define V_UIS_VD_ID V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x704)
#define V_UIS_KB_ID V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x705)
/* MF-specific data structures */
#define V_MF_PACKRGB V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x801)
#define V_MF_NUMTEXTSIZES V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x802)
/* NT windows flags go here */
#define VI_EXPOSE WM_USER + 30
#define VI_RESIZE WM_USER + 31
#define VI_CLOSE WM_USER + 32
#define VI_ERR WM_USER + 33
#define V_WIN_CLASS V_BUILD_FLAG( V_OPEN,1, 0x900)
#define V_WIN_STYLE V_BUILD_FLAG( V_OPEN,1, 0x901)
#define V_CLASS_NAME V_BUILD_FLAG( V_OPEN,1, 0x902)
#define V_HINSTANCE V_BUILD_FLAG( V_OPEN,1, 0x903)
#define V_PREV_INSTANCE V_BUILD_FLAG( V_OPEN,1, 0x904)
#define V_WIN32_NEWFONT V_BUILD_FLAG(V_SET |V_OPEN,2, 0x905)
#define V_WIN32_WINDOW_HANDLE V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x906)
#define V_WIN32_CURSOR V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x907)
#define V_WIN32_WINDOWPROC V_BUILD_FLAG( V_GET ,1, 0x908)
#define V_WIN32_DOUBLE_BUFFER V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x909)
#define V_WIN32_XORFLAG V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x90a)
#define V_WIN32_IS_DV_DEVICE V_BUILD_FLAG( V_GET ,2, 0x90b)
#define V_WIN32_HPALETTE V_BUILD_FLAG( V_GET|V_OPEN,1, 0x90c)
#define V_WIN32_ICON_NAME V_BUILD_FLAG(V_SET|V_GET|V_OPEN,1, 0x90d)
#define VP_PRINT_ORIENTATION V_BUILD_FLAG(V_SET ,1, 0x90e)
#define VP_PRINT_SCALE V_BUILD_FLAG(V_SET ,1, 0x90f)
#define VP_PRINT_QUALITY V_BUILD_FLAG(V_SET ,1, 0x911)
#define VP_PRINT_DEVICE V_BUILD_FLAG(V_SET ,1, 0x913)
#define VP_PRINT_PORT V_BUILD_FLAG(V_SET ,1, 0x914)
#define VP_PRINT_DRIVER V_BUILD_FLAG(V_SET ,1, 0x915)
#define VP_PRINT_NO_WARNING V_BUILD_FLAG(V_SET ,1, 0x916)
#define VP_PRINT_DOCUMENT_NAME V_BUILD_FLAG(V_SET ,1, 0x917)
#define VP_PRINT_ITER_COUNT V_BUILD_FLAG(V_SET ,1, 0x918)
#define V_WIN32_DC V_BUILD_FLAG( V_GET ,1, 0x919)
/* end of the NT windows flags */
/* keep some old names working */
#define V_X_FORM V_X_DRAW_WIDGET
#define V_FORM V_DRAW_WIDGET
#endif